from playhouse.pool import PooledMySQLDatabase

from app.conf import conf

mysql_db = PooledMySQLDatabase(
    conf.db_mysql_database,
    max_connections=20,
    stale_timeout=120,  # 2 minutes
    user=conf.db_mysql_user,
    password=conf.db_mysql_password,
    host=conf.db_mysql_host,
    port=conf.db_mysql_port,
)
